return function()
  -- mason 管理LSP
  require('mason').setup({
    PATH = 'append',
    github = {
      download_url_template = 'https://github.com/%s/releases/download/%s/%s',
    },
  })
  require('mason-lspconfig').setup({
    ensure_installed = { 'clangd', 'rust_analyzer', 'lua_ls', },
  })
  -- LSP具体配置
  local lspconfig = require('lspconfig')
  ---- 定义table,存放name和config
  local servers = {
    clangd = require('plugins.config.lsp.lang.cplusplus'),
    cssls = require('plugins.config.lsp.lang.css'),
    html = require('plugins.config.lsp.lang.html'),
    jsonls = require('plugins.config.lsp.lang.json'),
    lua_ls = require('plugins.config.lsp.lang.lua'),
    pyright = require('plugins.config.lsp.lang.python'),
    rust_analyzer = require('plugins.config.lsp.lang.rust'),
  }
  for name, config in pairs(servers) do
    if config ~= nil and type(config) == 'table' then
      -- 自定义初始化配置文件
      local server = lspconfig[name]
      config.setup(server)
    else
      -- 使用默认参数
      lspconfig[name].setup({})
    end
  end
  -------------- 诊断内容美化 -------------------
  -- 左侧边显示错误提示
  local diagnostic_icons = { Error = ' ', Warn = ' ', Info = ' ', Hint = ' 󰭻' }
  for type, icon in pairs(diagnostic_icons) do
    local name = 'DiagnosticSign' .. type
    vim.fn.sign_define(name, { text = icon, texthl = name, numhl = '' })
  end
  -- 错误信息展示美化
  vim.diagnostic.config({
    underline = true,
    update_in_insert = false,
    virtual_text = {
      spacing = 4,
      source = 'if_many',
      prefix = ' ',
    },
    severity_sort = true,
  })
end
